<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <ui:composition>
            <p:dialog id="CliViewParticipanteDialog" widgetVar="CliViewParticipanteDialog" modal="true" resizable="false" appendTo="@(body)" header="Participantes - #{tbInstController.selectedEvento.eventointerno}" width="50%" height="60%">
                <h:form id="CliViewParticipanteDialogForm" >
                    <h3 class="ui-dialog-title"></h3>
                    <h:panelGroup >
                        <p:commandButton value="#{bundle.Close}" onclick="TbInstViewDialog.hide()"/>
                        <p:commandButton value="Imprimir" type="button" icon="ui-icon-print"><p:printer target="datalistParticipante" /></p:commandButton>
                        <p:splitButton value="Exportar" icon="ui-icon-disk">
                            <p:menuitem value="PDF"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="pdf" target="datalist" fileName="Participante" /></p:menuitem>
                            <p:menuitem value="XLS"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="xls" target="datalist" fileName="Participante" /></p:menuitem>
                            <p:menuitem value="CSV"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="csv" target="datalist" fileName="Participante" /></p:menuitem>    
                            <p:menuitem value="XML"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="xml" target="datalist" fileName="Participante" /></p:menuitem>
                        </p:splitButton>
                        <br /><br />
                        <p:dataTable id="datalistParticipante" emptyMessage="Nenhum registro localizado"
                                     value="#{tbInstController.itemsEvento}" 
                                     var="itemCli"
                                     paginator="true"
                                     rowKey="#{itemCli.codInstituicao}"
                                     rows="10"
                                     paginatorPosition="bottom"
                                     rowsPerPageTemplate="20,30,40,50,100,200,1000" >

                            <p:column width="10%">
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListTbInstTitle_codInstituicao}"/>
                                </f:facet>
                                <h:outputText value="#{itemCli.codInstituicao}"/>
                            </p:column>
                            <p:column width="35%"> 
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListTbInstTitle_nomFantasia}"/>
                                </f:facet>
                                <h:outputText value="#{itemCli.nomFantasia}"/>
                            </p:column>
                            <p:column width="15%"> 
                                <f:facet name="header">
                                    <h:outputText value="Telefone"/>
                                </f:facet>
                                <h:outputText value="#{itemCli.desFone1}"/>
                            </p:column>
                            <p:column width="40%"> 
                                <f:facet name="header">
                                    <h:outputText value="#{bundle.ListTbInstTitle_desEmail}"/>
                                </f:facet>
                                <h:outputText value="#{itemCli.desEmail}"/>
                            </p:column>
                            <f:facet name="footer">    
                                <p:commandButton id="deleteAllButton" icon="ui-icon-trash" value="Deletar todos participantes" actionListener="#{tbInstController.deletaEventoParcipantes}" update=":growl,datalistParticipante" disabled="#{empty tbInstController.itemsEvento}">
                                    <p:confirm header="Confirmação" message="Confirma a exclusão de todos participantes deste evento?" icon="ui-icon-alert"/>
                                </p:commandButton>                            
                                <p:confirmDialog global="true">
                                    <p:commandButton value="Sim" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                                    <p:commandButton value="Não" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close"/>
                                </p:confirmDialog>                    
                            </f:facet>                           
                        </p:dataTable>
                        <p:commandButton value="#{bundle.Close}" onclick="TbInstViewDialog.hide()"/>
                        <p:commandButton value="Imprimir" type="button" icon="ui-icon-print"><p:printer target="datalistParticipante" /></p:commandButton>
                        <p:splitButton value="Exportar" icon="ui-icon-disk">
                            <p:menuitem value="PDF"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="pdf" target="datalistParticipante" fileName="Participante" /></p:menuitem>
                            <p:menuitem value="XLS"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="xls" target="datalistParticipante" fileName="Participante" /></p:menuitem>
                            <p:menuitem value="CSV"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="csv" target="datalistParticipante" fileName="Participante" /></p:menuitem>    
                            <p:menuitem value="XML"  icon="ui-icon-close"  ajax="false"><p:dataExporter type="xml" target="datalistParticipante" fileName="Participante" /></p:menuitem>
                        </p:splitButton>                
                    </h:panelGroup>
                 </h:form>
            </p:dialog>  
    </ui:composition>
</html>
